import { getCartNum } from '@/api/cart'
import { useAuth } from './auth'

export const useCartNum = async (ref) => {
  if (!useAuth({ showToast: false, isJump: false })) return ref

  try {
    const res = await getCartNum()
    ref.value = res
  } catch (err) {
    console.log(err)
  }

  return ref
}
